RangeMap allows specifying a range in which a value spams, quite useful for defining outcomes based on an input, experience gain progression, etc. Example Usage:
RangeMap!(int, string) colorRanges = "White"; //Default is "White" colorRanges[0..9] = "Red"; colorRanges[10..19] = "Green"; colorRanges[20..29] = "Blue" writeln(colorRanges[5]); //Prints "Red"
Uses binary search for finding the value range.
When the value is out of range, the value returned is the _default one.
Alternative to the slice syntax
See Implementation
RangeMap allows specifying a range in which a value spams, quite useful for defining outcomes based on an input, experience gain progression, etc. Example Usage: